<?php
/*------------------------------------------------------------------------------
this file is part of Web Application Kit http://webappkit.net
Copyright (C) 2006 J.Ducastel <jducastel@jducastel.fr>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
------------------------------------------------------------------------------*/

/**
* just pick a template into stores and feeds it
* @author J.Ducastel <jducastel@jducastel.fr>
* @version 
*/
class wakEventHandler_view extends wakService {
/*------------------------------------------------------------------------------
                                                                     constructor
------------------------------------------------------------------------------*/
	/**
	*
	* @access
	* /
	function wakEventHandler_view() {
		$this->__construct();
	}/**/
	
	/**
	* "real" constructor
	* @access
	* /
	function __construct() {
		parent::__construct();
		$lib=&wak::getservice('waklib');
		$lib->needclass('filenode');
	}/**/
/*------------------------------------------------------------------------------
                                                                  public methods
------------------------------------------------------------------------------*/
	/**
	* executes event and returns event's return vaalue
	* @param string $eventCall
	* @param wakParameters $parameters
	* @access public
	* @return mixed event result
	*/
	function & run($eventCall,$parameters) {
		$false=false;
		// searching for file
		//$FS=&wak::getservice('wakfilesystem');
		$id='event.'.substr($eventCall,5);
		// getting template
		$TS=&wak::getservice('waktemplatestorage');
		if (!$tpl=&$TS->getById($id))
			return $false;
		$data=$parameters->getAllAssoc();
		$r=$tpl->render($data);
		return $r;
	}/**/
	
	/**
	* 
	* @param
	* @access public
	* @return 
	* /
	function () {
		
	}/**/
/*------------------------------------------------------------------------------
                                                                      properties
------------------------------------------------------------------------------*/
	/**
	* @var type desc
	*/
	//var //
/*------------------------------------------------------------------------------
                                                                 private methods
------------------------------------------------------------------------------*/
	/**
	* 
	* @param
	* @access private
	* @return 
	* /
	function () {
		
	}/**/
	
	/**
	* 
	* @param
	* @access private
	* @return 
	* /
	function () {
		
	}/**/
}
?>
